package com.nchu.netspace.client;

import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;

/**
 * 传统 同步阻塞IO 网络编程客户端
 *
 * @author fujianjian
 * @project net-java-space
 * @date 2018/11/1 22:36
 */
public class BIOTCPClient {

    public static void main(String[] args) throws Exception {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress("127.0.0.1", 8080));

        OutputStream out = socket.getOutputStream();
        out.write("this is client say greet".getBytes());
        System.out.println("客户端发送数据结束");

    }

}
